<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
%>
<html>
<head>
    <meta charset="utf-8">
    <title>任务管理</title>
    <link href="<%=path %>/web/userinfo/css/my_info.css" rel="stylesheet">
    <link rel="stylesheet" href="<%=path%>/web/userinfo/css/log.css">
    <link rel="stylesheet" href="<%=path%>/web/userinfo/css/page.css">
</head>
<body>
<div class="my_info_title">任务管理</div>
<div class="my_info_title_3" style="margin-bottom: 20px">
    <ul>
        <li data-title="发布的任务"  style="margin-left:140px;border-left: 1px solid #CCC;">发布的任务</li>
        <li data-title="接受的任务"  >接受的任务</li>
        <li data-title="完成的任务"  class="task_head">完成的任务</li>
    </ul>
</div>
<div class="manage-jobs">
    <div class="single-manage-jobs table-responsive">

    </div>
</div>

<script src="<%=path %>/web/static/js/modules/jquery-3.4.1.min.js"></script>
<script src="<%=path %>/web/static/layui/layui.all.js"></script>
</body>
</html>
<script>
    $(function () {

        initData(1);

        $(".my_info_title_3 li").click(function(){
            if($(this).data("title")=="发布的任务")
            {
                $(window.parent.document).find("#crowdfunding_iframe").attr("src","<%=path%>/web/userinfo/task");
            }
            if($(this).data("title")=="接受的任务")
            {
                $(window.parent.document).find("#crowdfunding_iframe").attr("src","<%=path%>/web/userinfo/acceptTask");
            }
            if($(this).data("title")=="完成的任务")
            {
                $(window.parent.document).find("#crowdfunding_iframe").attr("src","<%=path%>/web/userinfo/finishTask");
            }
        })
    })

    function initData(pageNum) {   //完成任务页面初始化
        var pageNum = {pageNum: pageNum};
        $.get("${pageContext.request.contextPath}/web/userinfo/finishTaskList", pageNum, function (mes) {
                $(".single-manage-jobs").empty();
                $(".single-manage-jobs").html(mes);
            }
        );
    }
</script>